@import 'choices.js/public/assets/styles/choices.css';
@import './components/Editor/flatpickr/flatpickr.min.css';

.workspace-leaf-content[data-type='kanban'] {
  .view-content {
    padding: 0;
  }

  > .view-header {
    display: flex !important;
  }
}

.kanban-plugin {
  --lane-width: 272px;
}

.kanban-plugin {
  contain: content;
  height: 100%;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.kanban-plugin,
.kanban-plugin__drag-container {
  a.tag {
    padding-inline: var(--tag-padding-x);
    padding-block: var(--tag-padding-y);
  }
}

.kanban-plugin__table-wrapper {
  height: 100%;
  width: 100%;
  overflow: auto;
  padding-block-end: 40px;

  table {
    width: fit-content;
    margin-block: 0;
    margin-inline: auto;
    box-shadow: 0 0 0 var(--table-border-width) var(--table-border-color);
  }

  tr {
    width: fit-content;
  }

  --table-column-first-border-width: 0;
  --table-column-last-border-width: 0;
  --table-row-last-border-width: 0;

  th,
  td {
    text-align: start;
    vertical-align: top;
    font-size: 0.875rem;
    padding: 0 !important;
    height: 1px;

    &.mod-has-icon .kanban-plugin__table-cell-wrapper {
      padding-inline-end: var(--size-2-2);
    }

    .kanban-plugin__table-cell-wrapper {
      height: 100%;
      padding-inline: var(--size-4-2);
      padding-block: var(--size-2-2);
    }

    .kanban-plugin__item-prefix-button-wrapper input[type='checkbox'] {
      margin-block: 2px;
    }

    &:has(.markdown-source-view) {
      --background-primary: var(--background-primary-alt);
      background: var(--background-primary);
      outline: 2px solid var(--background-modifier-border-focus);
    }
  }

  thead tr > th {
    height: 1px;
    background-color: var(--background-primary);
    position: sticky;
    top: 0;
    z-index: 1;
    overflow: visible;

    &:nth-child(2n + 2) {
      background-color: var(--background-primary);
    }

    .kanban-plugin__table-cell-wrapper {
      height: 100%;
      padding-block: var(--size-2-2);
      padding-inline: var(--size-4-2) var(--size-2-2);
      box-shadow: 0 0 0 var(--table-border-width) var(--table-border-color);
    }
  }

  .resizer {
    position: absolute;
    top: 0;
    height: 100%;
    width: 5px;
    background: var(--table-selection-border-color);
    cursor: col-resize;
    user-select: none;
    touch-action: none;
  }

  .resizer.ltr {
    right: 0;
  }

  .resizer.rtl {
    left: 0;
  }

  .resizer.isResizing {
    opacity: 1;
  }

  @media (hover: hover) {
    .resizer {
      opacity: 0;
    }

    .resizer:hover {
      opacity: 1;
    }
  }

  .kanban-plugin__item-tags:not(:empty) {
    margin-block-start: -5px;
  }

  .kanban-plugin__item-metadata-date-relative {
    display: block;
  }

  .kanban-plugin__item-input-wrapper,
  .cm-table-widget,
  .kanban-plugin__item-title,
  .kanban-plugin__item-title-wrapper,
  .kanban-plugin__item-content-wrapper {
    height: 100%;
  }

  .kanban-plugin__item-title-wrapper {
    padding: 0;
  }
}

.kanban-plugin {
  .markdown-source-view.mod-cm6 {
    display: block;
    font-size: 0.875rem;

    .cm-scroller {
      overflow: visible;
    }
  }
}

.kanban-plugin__table-header {
  display: flex;
  gap: var(--size-4-2);
  align-items: center;
  justify-content: space-between;
}

.kanban-plugin__table-header-sort {
  line-height: 1;
  color: var(--text-faint);
  padding: 2px;
  border-radius: 4px;

  > span {
    display: flex;
  }

  div:hover > & {
    background-color: var(--background-modifier-hover);
  }
}

.kanban-plugin__cell-flex-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;

  .lucide-more-vertical {
    transform: none;
  }
}

.kanban-plugin__icon-wrapper {
  display: flex;
  line-height: 1;
  > .kanban-plugin__icon {
    display: flex;
  }
}

.kanban-plugin.something-is-dragging {
  cursor: grabbing;
  cursor: -webkit-grabbing;

  * {
    pointer-events: none;
  }
}

.kanban-plugin__item button,
.kanban-plugin__lane button,
.kanban-plugin button {
  line-height: 1;
  margin: 0;
  transition:
    100ms color,
    100ms background-color;
}

.kanban-plugin__search-wrapper {
  width: 100%;
  position: sticky;
  top: 0;
  left: 0;
  padding-block: 10px;
  padding-inline: 13px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 2;
  background-color: var(--background-primary);
}

button.kanban-plugin__search-cancel-button {
  display: flex;
  line-height: 1;
  padding: 6px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-secondary-alt);
  color: var(--text-muted);
  margin-block: 0;
  margin-inline: 5px 0;
  font-size: 16px;
}

button.kanban-plugin__search-cancel-button .kanban-plugin__icon {
  display: flex;
}

.kanban-plugin__icon {
  display: inline-block;
  line-height: 1;
  --icon-size: 1em;
}

.kanban-plugin__board {
  display: flex;
  width: 100%;
  height: 100%;

  > div {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1rem;
    width: fit-content;
    height: 100%;
  }

  &.kanban-plugin__vertical {
    > div {
      height: fit-content;
      width: 100%;
      flex-direction: column;
    }
  }
}

.is-mobile .view-content:not(.is-mobile-editing) .kanban-plugin__board > div {
  padding-bottom: calc(1rem + var(--mobile-navbar-height));
}

.kanban-plugin__board.is-adding-lane > div {
  padding-inline-end: calc(250px + 1rem);
}

.kanban-plugin__lane-wrapper {
  display: flex;
  flex-shrink: 0;
  margin-inline-end: 10px;
  max-height: 100%;
  width: var(--lane-width);

  .kanban-plugin__vertical & {
    margin-block-end: 10px;
    margin-inline-end: 0;
  }
}

.kanban-plugin__lane {
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--background-secondary);
  border-radius: 6px;
  border: 1px solid var(--background-modifier-border);

  .is-dropping > & {
    background-color: hsla(var(--interactive-accent-hsl), 0.15);
    border-color: hsla(var(--interactive-accent-hsl), 1);
    outline: 1px solid hsla(var(--interactive-accent-hsl), 1);
  }
}

.kanban-plugin__placeholder.kanban-plugin__lane-placeholder {
  height: 100%;
  flex-grow: 1;
  margin-inline-end: 5px;
}

.kanban-plugin__lane.is-hidden {
  display: none;
}

.kanban-plugin__lane button {
  padding-block: 8px;
  padding-inline: 10px;
}

.kanban-plugin__lane-form-wrapper {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 250px;
  background-color: var(--background-secondary);
  border-radius: 6px;
  border: 2px solid hsla(var(--interactive-accent-hsl), 0.7);
  z-index: var(--layer-popover);
  box-shadow:
    0px 0.5px 1px 0.5px rgba(0, 0, 0, 0.1),
    0px 2px 10px rgba(0, 0, 0, 0.1),
    0px 10px 20px rgba(0, 0, 0, 0.1);
}

.kanban-plugin__lane-input {
  --font-text-size: var(--font-ui-small);

  padding-block: var(--size-4-1);
  padding-inline: var(--size-4-2);
  background-color: var(--background-primary);
  border-radius: var(--radius-s);
}

.kanban-plugin__lane-input-wrapper {
  padding: 10px;
}

.kanban-plugin__item-input-actions,
.kanban-plugin__lane-input-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-block: 0 10px;
  padding-inline: 10px;
  button {
    display: block;
    margin-inline-end: 5px;
  }
}

button.kanban-plugin__item-action-add,
button.kanban-plugin__lane-action-add {
  background-color: var(--interactive-accent);
  color: var(--text-on-accent);
  &:hover {
    background-color: var(--interactive-accent-hover);
  }
}

.kanban-plugin__lane-header-wrapper {
  padding-block: 8px;
  padding-inline: 8px 12px;
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  flex-shrink: 0;
  flex-grow: 0;
  border-bottom: 1px solid var(--background-modifier-border);

  .collapse-horizontal &,
  .collapse-vertical & {
    border-bottom: none;
  }
}

.will-prepend .kanban-plugin__lane-header-wrapper {
  border-bottom: none;
}

.kanban-plugin__lane-wrapper.collapse-horizontal {
  width: auto;

  .kanban-plugin__lane-header-wrapper {
    writing-mode: vertical-lr;
  }

  .kanban-plugin__lane-header-wrapper {
    gap: var(--size-4-2);
  }

  .kanban-plugin__lane-title-count,
  .kanban-plugin__lane-title-text {
    transform: rotate(180deg);
  }

  .kanban-plugin__lane-settings-button-wrapper {
    display: none;
  }
}

.kanban-plugin__lane-wrapper.collapse-vertical {
  .kanban-plugin__lane-settings-button-wrapper {
    visibility: hidden;
  }
}

.kanban-plugin__lane-collapse {
  flex-grow: 0;
  color: var(--text-faint);

  > span {
    display: flex;
  }

  .collapse-vertical & {
    > span {
      transform: rotate(-90deg);
    }
  }
}

.kanban-plugin__lane-grip {
  cursor: grab;
  flex-grow: 0;
  color: var(--text-faint);
  &:active {
    cursor: grabbing;
  }
}

.kanban-plugin__lane-collapse svg {
  --icon-size: 1rem;
}

.kanban-plugin__lane-grip > svg {
  height: 1rem;
  display: block;
}

.kanban-plugin__lane-title {
  font-weight: 600;
  font-size: 0.875rem;
  flex-grow: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.kanban-plugin__lane-title-text {
  flex-grow: 1;
}

div.kanban-plugin__lane-title-count {
  border-radius: 3px;
  color: var(--text-muted);
  display: block;
  font-size: 13px;
  line-height: 1;
  padding: 4px;
}

div.kanban-plugin__lane-title-count.wip-exceeded {
  font-weight: bold;
  color: var(--text-normal);
  background-color: rgba(var(--background-modifier-error-rgb), 0.25);
}

.kanban-plugin__table-cell-wrapper .kanban-plugin__lane-menu,
.kanban-plugin__table-cell-wrapper .kanban-plugin__item-prefix-button,
.kanban-plugin__item .kanban-plugin__item-prefix-button,
.kanban-plugin__item .kanban-plugin__item-postfix-button,
.kanban-plugin__lane .kanban-plugin__lane-settings-button {
  --icon-stroke: 2.5px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  margin-inline-end: -4px;

  &.is-enabled {
    color: var(--text-accent);
  }
}

.kanban-plugin__table-cell-wrapper .kanban-plugin__lane-menu {
  color: var(--text-faint);
  margin-inline-start: 2px;
  margin-inline-end: 0px;
}

.kanban-plugin__table-cell-wrapper,
.kanban-plugin__item {
  .kanban-plugin__item-prefix-button {
    margin-inline-end: 4px;
    margin-inline-start: -4px;
  }

  button.kanban-plugin__item-prefix-button {
    margin-block: 4px;
    margin-inline: 0 7px;
    padding: 0;
  }
}

.kanban-plugin__lane-action-wrapper,
.kanban-plugin__item-edit-archive-button,
.kanban-plugin__item-settings-actions .kanban-plugin__icon,
.kanban-plugin__item-edit-archive-button > .kanban-plugin__icon,
.kanban-plugin__item-prefix-button > .kanban-plugin__icon,
.kanban-plugin__item-postfix-button > .kanban-plugin__icon,
.kanban-plugin__lane-settings-button > .kanban-plugin__icon {
  display: flex;
}

.kanban-plugin__lane-settings-button-wrapper {
  display: flex;
  gap: 4px;
}

button.kanban-plugin__lane-settings-button + button.kanban-plugin__lane-settings-button {
  margin-inline-start: 2px;
}

.kanban-plugin__lane-settings-button svg {
  width: 1em;
  height: 1em;
}

.kanban-plugin__lane-items-wrapper {
  margin: 4px;
  height: 100%;
}

.kanban-plugin__lane-items {
  padding: 4px;
  margin-block: 0;
  margin-inline: 4px;
  display: flex;
  flex-direction: column;
  > div {
    margin-block-start: 4px;
  }
}

.kanban-plugin__lane-items > .kanban-plugin__placeholder {
  flex-grow: 1;
  &:only-child {
    height: 2.55em;
    border: 3px dashed rgba(var(--text-muted-rgb), 0.1);
    margin-block-end: 4px;
    border-radius: 6px;
    transition: border 200ms ease;
  }
}

.is-sorting .kanban-plugin__lane-items > .kanban-plugin__placeholder:only-child {
  border-color: hsla(var(--interactive-accent-hsl), 0.6);
}

.kanban-plugin__item-button-wrapper {
  border-top: 1px solid var(--background-modifier-border);
  padding: 8px;
  flex-shrink: 0;
  flex-grow: 0;
  > button {
    text-align: left;
    width: 100%;
  }
}

.kanban-plugin__lane-header-wrapper + .kanban-plugin__item-button-wrapper {
  border-top: none;
  border-bottom: 1px solid var(--background-modifier-border);
  padding-block: 4px 8px;
  padding-inline: 8px;
}

.kanban-plugin__item-form {
  border-top: 1px solid var(--background-modifier-border);
  padding: 8px;
  .kanban-plugin__item-input-wrapper {
    padding-block: 6px;
    padding-inline: 8px;
    border: 1px solid var(--background-modifier-border);
    background-color: var(--background-primary);
    border-radius: var(--input-radius);
    min-height: var(--input-height);
  }
}

.kanban-plugin__lane-header-wrapper + .kanban-plugin__item-form {
  border-top: none;
  border-bottom: 1px solid var(--background-modifier-border);
  padding-block: 4px 8px;
  padding-inline: 8px;
}

.kanban-plugin__item-input-wrapper {
  --line-height-normal: var(--line-height-tight);

  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.kanban-plugin button.kanban-plugin__item-submit-button {
  flex-grow: 0;
  flex-shrink: 1;
  font-size: 14px;
  height: auto;
  line-height: 1;
  margin-block-start: 5px;
  width: auto;

  .is-mobile & {
    font-size: 12px;
  }
}

.is-mobile .kanban-plugin__lane-form-wrapper {
  --input-height: auto;

  button {
    padding-block: var(--size-4-2);
  }

  .markdown-source-view.mod-cm6 {
    font-size: var(--font-ui-medium);
  }
}

.is-mobile
  .kanban-plugin
  .kanban-plugin__lane-input-wrapper
  button.kanban-plugin__item-submit-button {
  display: none;
}

button.kanban-plugin__new-item-button {
  background-color: transparent;
  color: var(--text-muted);
}

.kanban-plugin__new-item-button:hover {
  color: var(--text-on-accent);
  background-color: var(--interactive-accent-hover);
}

.kanban-plugin__drag-container > .kanban-plugin__item-wrapper .kanban-plugin__item {
  border-color: var(--interactive-accent);
  box-shadow:
    var(--shadow-s),
    0 0 0 2px hsla(var(--interactive-accent-hsl), 0.7);
}

.kanban-plugin__item {
  font-size: 0.875rem;
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--input-radius);
  overflow: hidden;
  transition: 300ms opacity cubic-bezier(0.25, 1, 0.5, 1);

  &:has(.markdown-source-view) {
    outline: 1px solid var(--background-modifier-border-focus);
    border-color: var(--background-modifier-border-focus);
  }
}

.kanban-plugin__item-content-wrapper {
  background: var(--background-primary);
}

.kanban-plugin__item-title-wrapper {
  background: var(--background-primary);
  display: flex;
  padding-block: 6px;
  padding-inline: 8px;
  // align-items: center;

  &:not(:only-child) {
    border-bottom: 1px solid var(--background-modifier-border);
  }
}

.kanban-plugin__item-title {
  width: 100%;
  line-height: var(--line-height-tight);
  margin-block-start: 1px;
}

.kanban-plugin__meta-value,
.kanban-plugin__markdown-preview-wrapper {
  white-space: pre-wrap;
  white-space: break-spaces;
  word-break: break-word;
  overflow-wrap: anywhere;

  .markdown-preview-view {
    --file-margins: 0;
  }

  --font-text-size: 0.875rem;
  --line-height-normal: var(--line-height-tight);
  --p-spacing: var(--size-4-2);
  --list-indent: 1.75em;

  &.inline {
    display: inline-block;
  }

  .kanban-plugin__markdown-preview-view {
    > *:first-child {
      margin-block-start: 0;
    }

    > *:last-child {
      margin-block-end: 0;
    }
  }

  .markdown-preview-view {
    width: unset;
    height: unset;
    position: unset;
    overflow-y: unset;
    overflow-wrap: unset;
    color: unset;
    user-select: unset;
    -webkit-user-select: unset;
    white-space: normal;

    // p,
    // ul,
    // ol,
    .markdown-embed,
    blockquote {
      padding-inline: var(--size-4-2) 0;
      padding-block: var(--size-4-1);
      margin-block-start: var(--p-spacing);
      margin-block-end: var(--p-spacing);
    }
  }
}

.kanban-plugin__meta-value {
  .kanban-plugin__markdown-preview-view {
    display: inline-flex;

    > div:first-child > *:first-child {
      margin-block-start: 0;
    }

    > div:last-child > *:last-child {
      margin-block-end: 0;
    }
  }
}

.kanban-plugin__embed-link-wrapper {
  padding: 2px;
  float: right;
}

.kanban-plugin__item-metadata-wrapper:not(:empty) {
  background-color: var(--background-primary-alt);
  padding-inline: 8px;
  padding-block: 6px;
}

.kanban-plugin__item-metadata:not(:empty) {
  padding-block-start: 5px;
  font-size: 12px;

  .markdown-preview-view {
    line-height: var(--line-height-tight);
    font-size: inherit;
  }
}

.kanban-plugin__item-metadata > span {
  display: block;

  &.kanban-plugin__item-metadata-date-wrapper {
    display: inline-block;
  }
}

.kanban-plugin__item-metadata .is-button {
  cursor: var(--cursor);
  &:hover {
    color: var(--text-normal);
  }
}

.kanban-plugin__item-metadata-date-relative::first-letter {
  text-transform: uppercase;
}

.kanban-plugin__item-metadata a {
  text-decoration: none;
}

.kanban-plugin__item-task-inline-metadata-item,
.kanban-plugin__item-task-metadata-item {
  display: inline-flex;
  margin-block: 3px 0;
  margin-inline: 0 6px;
  gap: 4px;
}

.kanban-plugin__item-task-inline-metadata-item {
  padding-inline: 2px;
  background-color: var(--background-secondary);
  border-radius: var(--radius-s);
}

.kanban-plugin__table-cell-wrapper .kanban-plugin__item-task-inline-metadata-item {
  background-color: unset;
  padding-inline: unset;
  border-radius: unset;
}

.kanban-plugin__item-tags:not(:empty) {
  padding-block-start: 2px;
}

.kanban-plugin__item-tag {
  display: inline-block;
  margin-inline-end: 4px;
}

.kanban-plugin__item-tags .kanban-plugin__item-tag {
  font-size: 12px;
  background-color: var(--tag-background, hsla(var(--interactive-accent-hsl), 0.1));
  color: var(--tag-color, var(--text-accent));
  margin-block: 3px 0;
  margin-inline: 0 3px;
}

.kanban-plugin__item-tag.is-search-match,
.kanban-plugin__item-tags .kanban-plugin__item-tag.is-search-match {
  background-color: var(--text-highlight-bg);
  color: var(--text-normal);
}

.kanban-plugin__meta-table {
  width: 100%;
  margin: 0;
  line-height: var(--line-height-tight);
  font-size: 0.75rem;

  .markdown-preview-view {
    font-size: 0.75rem;
  }

  .kanban-plugin__item-tags .kanban-plugin__item-tag {
    position: relative;
    inset-block-start: -2px;
    margin-block: 0 3px;
  }

  td {
    vertical-align: top;
    padding-block: 3px 0;
    padding-inline: 0;
    width: 10%;
  }

  td + td {
    width: 90%;
  }

  td:only-child {
    width: 100%;
  }
}

.kanban-plugin__meta-table td.kanban-plugin__meta-key {
  white-space: nowrap;
  padding-inline-end: 5px;
  color: var(--text-muted);
}

.kanban-plugin__meta-table td.kanban-plugin__meta-key.is-search-match > span {
  background-color: var(--text-highlight-bg);
  color: var(--text-normal);
}

.kanban-plugin__meta-value:not(.mod-array) {
  white-space: pre-wrap;
  display: flex;
}

.kanban-plugin__meta-value > .is-search-match,
.kanban-plugin__meta-value.is-search-match {
  background-color: var(--text-highlight-bg);
  color: var(--text-normal);
}

.kanban-plugin__item-prefix-button-wrapper,
.kanban-plugin__item-postfix-button-wrapper {
  display: flex;
  flex-grow: 0;
  flex-shrink: 0;
  align-self: start;

  > div {
    display: flex;
    flex-direction: column;
    gap: var(--size-4-1);
  }
}

.kanban-plugin__item-prefix-button-wrapper {
  flex-direction: column;
}

.kanban-plugin__item-prefix-button-wrapper .kanban-plugin__item-prefix-button {
  width: var(--checkbox-size);
  height: var(--checkbox-size);
}

.kanban-plugin__item-prefix-button-wrapper .kanban-plugin__item-prefix-button,
.kanban-plugin__item-prefix-button-wrapper input[type='checkbox'] {
  margin-block: 2px;
  margin-inline: 0px 7px;
  + button {
    margin-block-start: 10px;
  }
}

button.kanban-plugin__item-postfix-button {
  visibility: hidden;
  opacity: 0;
  transition: 100ms opacity;
  display: flex;
  align-self: flex-start;
}

button.kanban-plugin__item-postfix-button.is-enabled,
.kanban-plugin__item:hover button.kanban-plugin__item-postfix-button {
  visibility: visible;
  opacity: 1;
}

.kanban-plugin__item-settings-actions {
  padding: 5px;
  display: flex;
}

.kanban-plugin__item-settings-actions > button {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  width: 100%;
}

.kanban-plugin__lane-action-wrapper button > .kanban-plugin__icon,
.kanban-plugin__item-settings-actions button > .kanban-plugin__icon {
  margin-inline-end: 5px;
}

.kanban-plugin__item-settings-actions > button:first-child,
.kanban-plugin__lane-action-wrapper > button:first-child {
  margin-inline-end: 2.5px;
}

.kanban-plugin__item-settings-actions > button:last-child,
.kanban-plugin__lane-action-wrapper > button:last-child {
  margin-inline-start: 2.5px;
}

.kanban-plugin__archive-lane-button,
.kanban-plugin__item-button-archive {
  color: var(--text-muted);
  border: 1px solid var(--background-modifier-border);
}

.kanban-plugin__archive-lane-button:hover,
.kanban-plugin__item-button-archive:hover {
  color: var(--text-normal);
}

.kanban-plugin__item-button-delete {
  border: 1px solid rgba(var(--background-modifier-error-rgb), 0.15);
  color: rgba(var(--background-modifier-error-rgb), 1);
}

.kanban-plugin__item-button-delete:hover {
  background-color: rgba(var(--background-modifier-error-rgb), 0.2);
  color: var(--text-error);
}

.theme-dark .kanban-plugin__item-button-delete {
  background-color: transparent;
  border: 1px solid rgba(var(--background-modifier-error-rgb), 1);
  color: var(--text-error);
}

.theme-dark .kanban-plugin__item-button-delete:hover {
  background-color: rgba(var(--background-modifier-error-rgb), 1);
  color: var(--text-error);
}

.kanban-plugin__checkbox-wrapper {
  border-top: 1px solid var(--background-modifier-border);
  border-bottom: 1px solid var(--background-modifier-border);
  padding: 10px;
  margin-block-end: 10px;
  display: flex;
  align-items: center;
}

.kanban-plugin__checkbox-wrapper .checkbox-container {
  flex-shrink: 0;
  flex-grow: 0;
  margin-inline-start: 15px;
}

.kanban-plugin__checkbox-label {
  font-size: 0.8125rem;
  line-height: var(--line-height-tight);
}

.kanban-plugin__lane-setting-wrapper > div {
  border-top: none;
  border-bottom: none;
  padding-block: 10px;
  padding-inline: 15px;
  margin-block-end: 0;
}

.kanban-plugin__lane-setting-wrapper > div:last-child {
  border-bottom: 1px solid var(--background-modifier-border);
  margin-block-end: 10px;
}

.kanban-plugin__action-confirm-wrapper {
  border: 1px solid rgba(var(--background-modifier-error-rgb), 0.2);
  background-color: rgba(var(--background-modifier-error-rgb), 0.1);
  border-radius: 4px;
  padding: 10px;
  margin-block: 5px;
  margin-inline: 10px;
}

.theme-dark .kanban-plugin__action-confirm-wrapper {
  border: 1px solid rgba(var(--background-modifier-error-rgb), 1);
}

.kanban-plugin__delete-lane-button,
.kanban-plugin__archive-lane-button {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  width: 50%;
}

.kanban-plugin__delete-lane-button {
  border: 1px solid rgba(var(--background-modifier-error-rgb), 0.15);
  color: rgba(var(--background-modifier-error-rgb), 1);
}

.kanban-plugin__delete-lane-button:hover {
  background-color: rgba(var(--background-modifier-error-rgb), 0.2);
  color: var(--text-error);
}

.theme-dark .kanban-plugin__delete-lane-button {
  background-color: transparent;
  border: 1px solid rgba(var(--background-modifier-error-rgb), 1);
  color: var(--text-error);
}

.theme-dark .kanban-plugin__delete-lane-button:hover {
  background-color: rgba(var(--background-modifier-error-rgb), 1);
  color: var(--text-error);
}

.kanban-plugin__action-confirm-text {
  font-size: 0.875rem;
  color: var(--text-error);
  margin-block-end: 10px;
  line-height: var(--line-height-tight);
}

button.kanban-plugin__confirm-action-button {
  border: 1px solid rgba(var(--background-modifier-error-rgb), 0.2);
  margin-inline-end: 5px;
  color: var(--text-error);

  &:hover {
    background-color: rgba(var(--background-modifier-error-rgb), 0.5);
  }
}

button.kanban-plugin__cancel-action-button {
  border: 1px solid var(--background-modifier-border);
}

.modal.kanban-plugin__board-settings-modal {
  width: var(--modal-width);
  height: var(--modal-height);
  max-height: var(--modal-max-height);
  max-width: var(--modal-max-width);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.modal.kanban-plugin__board-settings-modal .modal-content {
  padding-block: 30px;
  padding-inline: 50px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
}

.kanban-plugin__board-settings-modal .setting-item {
  flex-wrap: wrap;
  justify-content: space-between;
}

.kanban-plugin__board-settings-modal .setting-item-info {
  max-width: 400px;
  min-width: 300px;
  width: 50%;
}

.kanban-plugin__board-settings-modal .setting-item-control {
  min-width: 300px;
  flex-shrink: 0;
}

.kanban-plugin__board-settings-modal .choices {
  width: 100%;
  text-align: left;
}

.kanban-plugin__board-settings-modal .choices[data-type*='select-one'] .choices__inner {
  background-color: var(--background-primary);
  border-color: var(--background-modifier-border);
  padding: 0;
  min-height: 0;
}

.kanban-plugin__board-settings-modal .choices[data-type*='select-one'] .choices__input {
  background-color: var(--background-primary);
  border-bottom-color: var(--background-modifier-border);
  font-size: 14px;
}

.kanban-plugin__board-settings-modal .choices__input {
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
}

.kanban-plugin__board-settings-modal .choices__list[role='listbox'] {
  overflow-x: hidden;
}

.kanban-plugin__board-settings-modal .choices__list--single {
  padding-block: 4px;
  padding-inline: 6px 20px;
}

.kanban-plugin__board-settings-modal .is-open .choices__list--dropdown,
.kanban-plugin__board-settings-modal .choices__list--dropdown {
  background-color: var(--background-primary);
  border-color: var(--background-modifier-border);
  word-break: normal;
  max-height: 200px;
  display: flex;
  flex-direction: column;
}

.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item--selectable:after {
  display: none;
}

.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item--selectable {
  padding-block: 4px;
  padding-inline: 6px;
}

.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item.is-highlighted {
  background-color: var(--background-primary-alt);
}

.kanban-plugin__board-settings-modal .choices__placeholder {
  opacity: 1;
  color: var(--text-muted);
}

.kanban-plugin__board-settings-modal .error {
  border-color: var(--background-modifier-error-hover) !important;
}

.kanban-plugin__date-picker {
  position: absolute;
  z-index: var(--layer-popover);

  --cell-size: 2.4em;
}

.kanban-plugin__date-picker .flatpickr-input {
  width: 0;
  height: 0;
  opacity: 0;
  border: none;
  padding: 0;
  display: block;
  margin-block-end: -1px;
}

.kanban-plugin__date-picker .flatpickr-current-month {
  color: var(--text-normal);
  font-weight: 600;
  font-size: inherit;
  width: 100%;
  position: static;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.kanban-plugin__date-picker .flatpickr-current-month .numInputWrapper span.arrowUp:after {
  border-bottom-color: var(--text-normal);
}

.kanban-plugin__date-picker .flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-top-color: var(--text-normal);
}

.flatpickr-months .flatpickr-prev-month svg path,
.flatpickr-months .flatpickr-next-month svg path {
  fill: currentColor;
}

.kanban-plugin__date-picker .flatpickr-calendar {
  border-radius: var(--radius-m);
  font-size: 13px;
  overflow: hidden;
  background-color: var(--background-primary);
  width: calc(var(--cell-size) * 7 + 8px);
  box-shadow:
    0 0 0 1px var(--background-modifier-border),
    0px 15px 25px rgba(0, 0, 0, 0.2);

  &.inline {
    top: 0;
  }
}

.kanban-plugin__date-picker .flatpickr-months {
  font-size: 13px;
  padding-block: 2px 4px;
  padding-inline: 2px;
  align-items: center;
}

.kanban-plugin__date-picker .flatpickr-months .flatpickr-current-month input.cur-year,
.kanban-plugin__date-picker .flatpickr-months select {
  border-radius: 4px;
  padding: 4px;
}

.kanban-plugin__date-picker .flatpickr-months .numInputWrapper {
  border-radius: 4px;
}

.kanban-plugin__date-picker .flatpickr-months .flatpickr-month {
  width: 100%;
  height: auto;
}

.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month,
.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month {
  color: var(--text-normal);
  fill: currentColor;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: auto;
  padding: 5px;
  position: static;
  flex-shrink: 0;
}

.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month:hover,
.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month:hover {
  background-color: var(--background-primary-alt);
  color: var(--text-normal);
}

.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month:hover svg,
.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month:hover svg {
  fill: currentColor;
}

.kanban-plugin__date-picker .flatpickr-current-month .flatpickr-monthDropdown-months {
  box-shadow: none;
  color: var(--text-normal);
  font-weight: inherit;
  margin-inline-end: 5px;
}

.kanban-plugin__date-picker .flatpickr-current-month input.cur-year {
  color: var(--text-normal);
  font-weight: inherit;
}

.kanban-plugin__date-picker .flatpickr-weekdays {
  height: auto;
  padding-block: 8px 12px;
  padding-inline: 0;
}

.kanban-plugin__date-picker span.flatpickr-weekday {
  font-weight: 400;
  color: var(--text-muted);
}

.kanban-plugin__date-picker .flatpickr-innerContainer {
  padding: 4px;
}

.kanban-plugin__date-picker .flatpickr-day {
  color: var(--text-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cell-size);
  height: var(--cell-size);
  line-height: 1;
  border-radius: 6px;
}

.kanban-plugin__date-picker .flatpickr-day.today {
  border-color: var(--interactive-accent);
}

.kanban-plugin__date-picker .flatpickr-day.today:hover {
  color: var(--text-normal);
  border-color: var(--interactive-accent);
  background-color: var(--background-primary-alt);
}

.kanban-plugin__date-picker .flatpickr-day.selected {
  border-color: var(--interactive-accent);
  background-color: var(--interactive-accent);
  color: var(--text-on-accent);
}

.kanban-plugin__date-picker .flatpickr-day.selected:hover {
  border-color: var(--interactive-accent);
  background-color: var(--interactive-accent);
}

.kanban-plugin__date-picker .flatpickr-days {
  width: calc(var(--cell-size) * 7);
}

.kanban-plugin__date-picker .dayContainer {
  width: calc(var(--cell-size) * 7);
  min-width: calc(var(--cell-size) * 7);
  max-width: calc(var(--cell-size) * 7);
}

.kanban-plugin__date-picker .flatpickr-day.inRange,
.kanban-plugin__date-picker .flatpickr-day.prevMonthDay.inRange,
.kanban-plugin__date-picker .flatpickr-day.nextMonthDay.inRange,
.kanban-plugin__date-picker .flatpickr-day.today.inRange,
.kanban-plugin__date-picker .flatpickr-day.prevMonthDay.today.inRange,
.kanban-plugin__date-picker .flatpickr-day.nextMonthDay.today.inRange,
.kanban-plugin__date-picker .flatpickr-day:hover,
.kanban-plugin__date-picker .flatpickr-day.prevMonthDay:hover,
.kanban-plugin__date-picker .flatpickr-day.nextMonthDay:hover,
.kanban-plugin__date-picker .flatpickr-day:focus,
.kanban-plugin__date-picker .flatpickr-day.prevMonthDay:focus,
.kanban-plugin__date-picker .flatpickr-day.nextMonthDay:focus {
  background-color: var(--background-primary-alt);
  border-color: var(--background-primary-alt);
}

.kanban-plugin__date-picker .flatpickr-day.flatpickr-disabled,
.kanban-plugin__date-picker .flatpickr-day.flatpickr-disabled:hover,
.kanban-plugin__date-picker .flatpickr-day.prevMonthDay,
.kanban-plugin__date-picker .flatpickr-day.nextMonthDay,
.kanban-plugin__date-picker .flatpickr-day.notAllowed,
.kanban-plugin__date-picker .flatpickr-day.notAllowed.prevMonthDay,
.kanban-plugin__date-picker .flatpickr-day.notAllowed.nextMonthDay {
  color: var(--text-faint);
}

.kanban-plugin__time-picker {
  position: absolute;
  max-height: 250px;
  overflow: auto;
  border-radius: 4px;
  border: 1px solid var(--background-modifier-border);
  box-shadow: 0 2px 8px var(--background-modifier-box-shadow);
  background: var(--background-primary);
  color: var(--text-normal);
  font-size: 14px;
  z-index: var(--layer-menu);
}

.kanban-plugin__time-picker-item {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  cursor: var(--cursor);
  line-height: 1;
  padding-block: 6px;
  padding-inline: 8px;
}

.kanban-plugin__time-picker-check {
  visibility: hidden;
  display: inline-flex;
  margin-inline-end: 5px;
}

.kanban-plugin__time-picker-item.is-hour {
  color: var(--text-normal);
  font-weight: 600;
}

.kanban-plugin__time-picker-item.is-selected .kanban-plugin__time-picker-check {
  visibility: visible;
}

.kanban-plugin__time-picker-item:hover,
.kanban-plugin__time-picker-item.is-selected {
  background: var(--background-secondary);
}

.kanban-plugin mark {
  background-color: var(--text-highlight-bg);
}

.kanban-plugin__draggable-setting-container {
  border-top: 0;
  padding: 0;
  flex-direction: column;
  > div {
    width: 100%;
    margin-inline-end: 0 !important;
  }
}

.kanban-plugin__setting-item-wrapper {
  border-top: 1px solid var(--background-modifier-border);
}

.kanban-plugin__draggable-setting-container > .kanban-plugin__placeholder {
  border-top: 1px solid var(--background-modifier-border);
}

.kanban-plugin__setting-item {
  background-color: var(--background-secondary);
  width: 100%;
  font-size: 16px;
  display: flex;
  align-items: flex-start;
  padding: 12px;
  color: var(--text-muted);
}

.kanban-plugin__drag-container .kanban-plugin__setting-item {
  border: 1px solid hsla(var(--interactive-accent-hsl), 0.8);
  box-shadow:
    0px 15px 25px rgba(0, 0, 0, 0.2),
    0 0 0 2px hsla(var(--interactive-accent-hsl), 0.8);
}

.kanban-plugin__setting-controls-wrapper {
  flex-grow: 1;
  flex-shrink: 1;
}

.kanban-plugin__setting-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  margin-block-end: 1rem;

  > div {
    margin-inline-end: 10px;
  }
}

.kanban-plugin__setting-toggle-wrapper {
  > div {
    display: flex;
    align-items: center;
    line-height: 1;
    margin-block-end: 10px;
  }
  .checkbox-container {
    margin-inline-end: 10px;
  }
}

.kanban-plugin__setting-button-wrapper {
  display: flex;
  justify-content: flex-end;
  flex-grow: 1;
  flex-shrink: 0;
  max-width: 25px;
  > div {
    margin-inline-start: 12px;
  }
}

.kanban-plugin__setting-key-input-wrapper {
  margin-block: 1rem;
  margin-inline: 0;
  > input {
    margin-inline-end: 10px;
  }
}

.kanban-plugin__date-color-input-wrapper,
.kanban-plugin__tag-sort-input-wrapper,
.kanban-plugin__tag-color-input-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 1rem;
}

.kanban-plugin__tag-sort-input-wrapper {
  .kanban-plugin__setting-key-input-wrapper {
    margin-block-start: 0;
  }
  .kanban-plugin__setting-input-wrapper {
    margin: 0;
  }
}

.kanban-plugin__add-tag-color-button {
  align-self: baseline;
  margin: 0;
}

.kanban-plugin__date-color-wrapper,
.kanban-plugin__tag-color-input .kanban-plugin__item-tags {
  background-color: var(--background-primary);
  padding: 10px;
  margin: 0;
  border-radius: 4px;
}

.kanban-plugin__tag-color-input .kanban-plugin__item-tag {
  margin-block-start: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.kanban-plugin__date-color-input-wrapper input[type='number'] {
  width: 75px;
  padding-block: 0.6em;
  padding-inline: 0.8em;
  height: auto;
  border-radius: 0.5em;
}

.kanban-plugin__date-color-input-wrapper .kanban-plugin__setting-item-label {
  margin-block-end: 0;
}

.kanban-plugin__date-color-config {
  padding-block: 0 10px;
  padding-inline: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.kanban-plugin__date-color-wrapper {
  display: inline-block;
  margin-block-start: 10px;
}

.kanban-plugin__date-color-wrapper .kanban-plugin__item-metadata {
  padding: 0;
}

.kanban-plugin__metadata-setting-desc {
  font-size: 14px;
}

.kanban-plugin__setting-button-spacer {
  visibility: hidden;
}

.kanban-plugin__setting-item-label {
  font-size: 12px;
  font-weight: bold;
  margin-block-end: 5px;
}

.kanban-plugin__setting-toggle-wrapper .kanban-plugin__setting-item-label {
  margin-block-end: 0;
}

.kanban-plugin__hitbox {
  border: 2px dashed tomato;
}

.kanban-plugin__placeholder {
  flex-grow: 0;
  flex-shrink: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.kanban-plugin__placeholder[data-axis='horizontal'] {
  height: 100%;
}

.kanban-plugin__placeholder[data-axis='vertical'] {
  width: 100%;
}

body:not(.native-scrollbars) .kanban-plugin__scroll-container::-webkit-scrollbar {
  background-color: transparent;
  width: 16px;
  height: 16px;
}

body:not(.native-scrollbars) .kanban-plugin__scroll-container::-webkit-scrollbar-thumb {
  border: 4px solid transparent;
  background-clip: content-box;
}

.kanban-plugin__scroll-container {
  will-change: transform;
}

.kanban-plugin__scroll-container.kanban-plugin__horizontal {
  overflow-y: hidden;
  overflow-x: auto;
}

.kanban-plugin__scroll-container.kanban-plugin__vertical {
  overflow-y: auto;
  overflow-x: hidden;
}

.kanban-plugin__drag-container {
  contain: layout size;
  z-index: 10000;
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
}

.kanban-plugin__loading {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sk-pulse {
  width: 60px;
  height: 60px;
  background-color: var(--text-faint);
  border-radius: 100%;
  animation: sk-pulse 1.2s infinite cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

@keyframes sk-pulse {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.kanban-plugin__color-picker-wrapper {
  position: relative;
}

.kanban-plugin__color-picker {
  position: absolute;
  top: -5px;
  left: 0;
  transform: translate(0, -100%);
}

.kanban-plugin__date,
.cm-kanban-time-wrapper,
.cm-kanban-date-wrapper {
  display: inline-block;
  color: var(--date-color);
  border-radius: var(--radius-s);
  background-color: var(--date-background-color, rgba(var(--mono-rgb-100), 0.05));

  &:hover {
    background-color: var(--date-background-color, rgba(var(--mono-rgb-100), 0.1));
  }

  &.kanban-plugin__preview-date-link {
    --link-decoration: none;
    --link-unresolved-decoration-style: unset;
  }

  > span,
  > a {
    padding-inline: var(--size-2-1);
  }
}

.completion .kanban-plugin__date.has-background {
  color: inherit;
  background-color: transparent;
  &:hover {
    background-color: transparent;
  }
}

.is-date .kanban-plugin__date:not(.has-background) {
  background-color: transparent;
  &:hover {
    background-color: transparent;
  }
}

.kanban-plugin__meta-value {
  .kanban-plugin__date:hover {
    background-color: var(--date-background-color, rgba(var(--mono-rgb-100), 0.05));
  }
}
